using System;
using System.ComponentModel;
using System.Net;
using System.Runtime.Remoting;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Web.Services.Protocols;

namespace Grain.Crm.DataMigrator.CrmServices
{
    public interface ICrmService
    {
        CrmAuthenticationToken CrmAuthenticationTokenValue { get; set; }
        CallerOriginToken CallerOriginTokenValue { get; set; }
        CorrelationToken CorrelationTokenValue { get; set; }
        SoapProtocolVersion SoapVersion { get; set; }
        bool AllowAutoRedirect { get; set; }
        CookieContainer CookieContainer { get; set; }
        X509CertificateCollection ClientCertificates { get; }
        bool EnableDecompression { get; set; }
        string UserAgent { get; set; }
        IWebProxy Proxy { get; set; }
        bool UnsafeAuthenticatedConnectionSharing { get; set; }
        ICredentials Credentials { get; set; }
        bool UseDefaultCredentials { get; set; }
        string ConnectionGroupName { get; set; }
        bool PreAuthenticate { get; set; }
        string Url { get; set; }
        Encoding RequestEncoding { get; set; }
        int Timeout { get; set; }
        ISite Site { get; set; }
        IContainer Container { get; }

        /// <remarks/>
        event ExecuteCompletedEventHandler ExecuteCompleted;

        /// <remarks/>
        event FetchCompletedEventHandler FetchCompleted;

        /// <remarks/>
        event CreateCompletedEventHandler CreateCompleted;

        /// <remarks/>
        event DeleteCompletedEventHandler DeleteCompleted;

        /// <remarks/>
        event RetrieveCompletedEventHandler RetrieveCompleted;

        /// <remarks/>
        event RetrieveMultipleCompletedEventHandler RetrieveMultipleCompleted;

        /// <remarks/>
        event UpdateCompletedEventHandler UpdateCompleted;

        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("CorrelationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CrmAuthenticationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CallerOriginTokenValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/crm/2007/WebServices/Execute", RequestNamespace="http://schemas.microsoft.com/crm/2007/WebServices", ResponseNamespace="http://schemas.microsoft.com/crm/2007/WebServices", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("Response")]
        Response Execute(Request Request);

        /// <remarks/>
        void ExecuteAsync(Request Request);

        /// <remarks/>
        void ExecuteAsync(Request Request, object userState);

        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("CorrelationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CrmAuthenticationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CallerOriginTokenValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/crm/2007/WebServices/Fetch", RequestNamespace="http://schemas.microsoft.com/crm/2007/WebServices", ResponseNamespace="http://schemas.microsoft.com/crm/2007/WebServices", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        string Fetch(string fetchXml);

        /// <remarks/>
        void FetchAsync(string fetchXml);

        /// <remarks/>
        void FetchAsync(string fetchXml, object userState);

        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("CorrelationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CrmAuthenticationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CallerOriginTokenValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/crm/2007/WebServices/Create", RequestNamespace="http://schemas.microsoft.com/crm/2007/WebServices", ResponseNamespace="http://schemas.microsoft.com/crm/2007/WebServices", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        System.Guid Create(BusinessEntity entity);

        /// <remarks/>
        void CreateAsync(BusinessEntity entity);

        /// <remarks/>
        void CreateAsync(BusinessEntity entity, object userState);

        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("CorrelationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CrmAuthenticationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CallerOriginTokenValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/crm/2007/WebServices/Delete", RequestNamespace="http://schemas.microsoft.com/crm/2007/WebServices", ResponseNamespace="http://schemas.microsoft.com/crm/2007/WebServices", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        void Delete(string entityName, System.Guid id);

        /// <remarks/>
        void DeleteAsync(string entityName, System.Guid id);

        /// <remarks/>
        void DeleteAsync(string entityName, System.Guid id, object userState);

        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("CorrelationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CrmAuthenticationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CallerOriginTokenValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/crm/2007/WebServices/Retrieve", RequestNamespace="http://schemas.microsoft.com/crm/2007/WebServices", ResponseNamespace="http://schemas.microsoft.com/crm/2007/WebServices", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        BusinessEntity Retrieve(string entityName, System.Guid id, ColumnSetBase columnSet);

        /// <remarks/>
        void RetrieveAsync(string entityName, System.Guid id, ColumnSetBase columnSet);

        /// <remarks/>
        void RetrieveAsync(string entityName, System.Guid id, ColumnSetBase columnSet, object userState);

        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("CorrelationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CrmAuthenticationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CallerOriginTokenValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple", RequestNamespace="http://schemas.microsoft.com/crm/2007/WebServices", ResponseNamespace="http://schemas.microsoft.com/crm/2007/WebServices", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        BusinessEntityCollection RetrieveMultiple(QueryBase query);

        /// <remarks/>
        void RetrieveMultipleAsync(QueryBase query);

        /// <remarks/>
        void RetrieveMultipleAsync(QueryBase query, object userState);

        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("CorrelationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CrmAuthenticationTokenValue")]
        [System.Web.Services.Protocols.SoapHeaderAttribute("CallerOriginTokenValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/crm/2007/WebServices/Update", RequestNamespace="http://schemas.microsoft.com/crm/2007/WebServices", ResponseNamespace="http://schemas.microsoft.com/crm/2007/WebServices", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        void Update(BusinessEntity entity);

        /// <remarks/>
        void UpdateAsync(BusinessEntity entity);

        /// <remarks/>
        void UpdateAsync(BusinessEntity entity, object userState);

        /// <remarks/>
        new void CancelAsync(object userState);

        void Discover();
        void Abort();
        void Dispose();
        string ToString();
        event EventHandler Disposed;
        object GetLifetimeService();
        object InitializeLifetimeService();
        ObjRef CreateObjRef(Type requestedType);
    }
}